""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" iHao vimrc file
" Version : 1.4
" Last modify : 2009.01.20
" Site : http://ihao.net/
" Plugins : 
"		NERDTree [http://www.vim.org/scripts/script.php?script_id=1658]
"		NERD_commenter [http://www.vim.org/scripts/script.php?script_id=1218]
"		snippetsEmu (snippy_plugin|snippy_bundles) [http://www.vim.org/scripts/script.php?script_id=1318]
"		miniBufExplorer [http://www.vim.org/scripts/script.php?script_id=159]
"		surround [http://www.vim.org/scripts/script.php?script_id=1697]
"		-Taglist- [http://www.vim.org/scripts/script.php?script_id=273]
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" General
"""""""""""""""""""""""""""""""""""""""""""""""
filetype on " detect the type of file
filetype plugin on " load filetype plugins
set nocompatible " get out of horrible vi-compatible mode
set history=100 " How many lines of history to remember
set ffs=unix,dos,mac " support all three, in this order
set viminfo+=! " make sure it can save viminfo
set encoding=prc " encoding setting
set fileencoding=utf8 " default file encoding 
set fileencodings=utf-8,bg2312,gbk,default
set termencoding=utf-8
set guifont=Courier_New:h14

" for chinese help
if version >= 603
	set helplang=cn
endi

" open code indent
set fdm=marker " values [manual|indent|expr|syntax|diff|marker]

"""""""""""""""""""""""""""""""""""""""""""""""
" Theme/Colors
"""""""""""""""""""""""""""""""""""""""""""""""
syntax on " syntax highlighting on
colorscheme desert " color scheme [darkblue|desert|blue|pablo|ron]
set background=dark " using a dark background

"""""""""""""""""""""""""""""""""""""""""""""""
" Files/Backups
"""""""""""""""""""""""""""""""""""""""""""""""
set nobackup " make backup file
set backupdir=d:\temp " where to put backup file
set directory=d:\temp " directory is the directory for temp file
"set makeef=error.err " when using make, where should it dump the file

"""""""""""""""""""""""""""""""""""""""""""""""
" vim ui
"""""""""""""""""""""""""""""""""""""""""""""""
set number " turn on line numbers
set lsp=1 " space it out a little more (easier to read)
set nowildmenu " turn [on|off] wild menu [wildmenu|nowildmenu]
set ruler " always show current positions along the bottom
set cmdheight=2 " the command bar is 2 high
set guioptions-=T " turn off gui option title

"""""""""""""""""""""""""""""""""""""""""""""""
" visual cues
"""""""""""""""""""""""""""""""""""""""""""""""
set showmatch " show matching brackets
set lines=80 " 80 lines tall
set columns=110 " 110 cols wide
set so=2 " keep 2 lines (top/bottom) for scope
set nohls " do not highlight searched for phrases
set incsearch " but do highlight as you type your search phrase

"""""""""""""""""""""""""""""""""""""""""""""""
" text formatting/layout
"""""""""""""""""""""""""""""""""""""""""""""""
set ai " autoindent
set si " smartindent
set tabstop=4 " tab spacing
set softtabstop=4 " unify
set shiftwidth=4 " unify
set noexpandtab " real tabs [expandtab|noexpandtab]


"""""""""""""""""""""""""""""""""""""""""""""""
" plugin setting
"""""""""""""""""""""""""""""""""""""""""""""""

" taglist
"""""""""""""""""""""""""""""""""""""""""""""""
"let Tlist_Ctags_Cmd = 'c:\ctags.exe'
"let Tlist_Show_One_File=1
"let Tlist_Exit_OnlyWindow=1

" winmanager
"""""""""""""""""""""""""""""""""""""""""""""""
"let g:winManagerWindowLayout='FileExplorer|TagList' "custme wm layout
"nmap zm :WMToggle<cr>  "open wm windows

" MiniBufExplorer
"""""""""""""""""""""""""""""""""""""""""""""""
let g:miniBufExplMapCTabSwitchBufs = 1 " use <C-Tab> or <C-S-Tab> open buffer and current tag
let g:miniBufExplMapWindowNavVim = 1 " use <C-h,j,k,l> switch window
"let g:miniBufExplMapWindowNavArrows = 1 " use <C-Arrow> switch window

" NERDTree
"""""""""""""""""""""""""""""""""""""""""""""""
let NERDTreeShowBookmarks = 1
nmap zx :NERDTreeToggle<cr>

"""""""""""""""""""""""""""""""""""""""""""""""
" other setting
"""""""""""""""""""""""""""""""""""""""""""""""
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

" ihao comment key
":ab #b /***************************
":ab #e <space>**************************/

"""""""""""""""""""""""""""""""""""""""""""""""
" auto write file header
"""""""""""""""""""""""""""""""""""""""""""""""
"autocmd BufWritePre,FileWritePre *.htm,*.html,*.jsp,*.xml,*.css,*.js,*.itc  ks|call LastMod()|'s
fun LastMod()
    let l = line("$")
	exe "1," . l . "g/@Author: /s/@Author: .*/@Author: iHao"
    exe "1," . l . "g/@Update: /s/@Update: .*/@Update:" .
			\ strftime(" %Y-%m-%d %X") . " by iHao"
endfun

"""""""""""""""""""""""""""""""""""""""""""""""
" for word complete plugin
"""""""""""""""""""""""""""""""""""""""""""""""
"let g:WC_min_len=3 "more then 3 letter do word complete
":autocmd BufEnter * call DoWordComplete() "auto turn on word complete
